import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    redirect: '/universities',
  },
  {
    path: '/universities',
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () => import(/* webpackChunkName: "Universities" */ '../views/universities/Universities'),
    meta:{
      title: 'University Map | 全国高校'
    }
  },
  {
    path: '/league',
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () => import(/* webpackChunkName: "League" */ '../views/league/League'),
    meta:{
      title: 'University Map | 高校联盟'
    }
  },
  {
    path: '/league-map',
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () => import(/* webpackChunkName: "LeagueMap" */ '../views/league/LeagueMap'),
    meta:{
      title: 'University Map | 联盟之子'
    }
  },
  {
    path: '/province',
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () => import(/* webpackChunkName: "Province" */ '../views/province/Province'),
    meta:{
      title: 'University Map | 省内大佬'
    }
  },
  {
    path: '/street-view',
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () => import(/* webpackChunkName: "StreetView" */ '../views/street-view/StreetView'),
    meta:{
      title: 'University Map | 随机街景'
    }
  },
  {
    path: '/contact',
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () => import(/* webpackChunkName: "StreetView" */ '../views/contact/Contact'),
    meta:{
      title: 'University Map | 联系我们'
    }
  }
]

const router = new VueRouter({
  routes
})

export default router
